﻿namespace KinonekoSoftware.Studio.Resources.Converters
{
    public class ObjectNameSelectorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (Selector is null)
            {
                return value;
            }

            return Selector(value);
        }
        
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
        
        public ObjectNameSelector Selector { get; set; }
    }
}